﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace Jy123.Web.Letter
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class CommentDel : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string strUserIdFromCookie = Common.Cookie.getCookie("UserID");
            if (string.IsNullOrEmpty(strUserIdFromCookie))
            {
                context.Response.Redirect("/");
            }
            int userID = int.Parse(strUserIdFromCookie);

            string msg = string.Empty;
            string strCommentID = context.Request["CommentID"];
            if (!string.IsNullOrEmpty(strCommentID))
            {
                new Jy123.BLL.User_LetterComment().Delete(Convert.ToInt32(strCommentID));
                msg = "删除成功!,ok";
            }
            else
            {
                msg = "删除失败!,error";
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(msg);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
